//
//  SearchSupplyResultViewController.m
//  Globalstone
//
//  Created by 刘建峰 on 16/8/10.
//  Copyright © 2016年 yuf. All rights reserved.
//

#import "SearchSupplyResultViewController.h"

@interface SearchSupplyResultViewController ()
@property (weak, nonatomic) IBOutlet UIView *navView;
@property (weak, nonatomic) IBOutlet UIScrollView *scroView;

@property (weak, nonatomic) IBOutlet UILabel *goodsName;
@property (weak, nonatomic) IBOutlet UILabel *businessType;
@property (weak, nonatomic) IBOutlet UILabel *stoneName;
@property (weak, nonatomic) IBOutlet UILabel *productPlace;


@property (weak, nonatomic) IBOutlet UILabel *goodsAddress;
@property (weak, nonatomic) IBOutlet UILabel *goodsWeight;
@property (weak, nonatomic) IBOutlet UILabel *customName;
@property (weak, nonatomic) IBOutlet UILabel *goodsQuality;
@property (weak, nonatomic) IBOutlet UILabel *startAddress;
@property (weak, nonatomic) IBOutlet UILabel *endAddresss;
@property (weak, nonatomic) IBOutlet UILabel *transCompany;
@property (weak, nonatomic) IBOutlet UILabel *passDate;
@property (weak, nonatomic) IBOutlet UILabel *transWeight;
@property (weak, nonatomic) IBOutlet UILabel *loanCompany;


@property (weak, nonatomic) IBOutlet UILabel *startDate;




@end

@implementation SearchSupplyResultViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self initViewLayout];
}

- (void)initViewLayout{
    [self adaptiveViewLayout:self.view];
    [self adaptiveViewLayout:self.navView];
    [self adaptiveViewLayout:self.scroView];
    
    _scroView.contentSize = flexibleSize(CGSizeMake(0, 1016), NO);
    
    if (_infoDic) {
        NSDictionary * stoneDic = _infoDic[@"orderStone"];
        _goodsName.text = [NSString stringWithFormat:@"%@",stoneDic[@"stoneName"]];
        _businessType.text = [NSString stringWithFormat:@"%@",stoneDic[@"stoneType"]];
        _stoneName.text = [NSString stringWithFormat:@"%@",stoneDic[@"msfoName"]];
        _productPlace.text = [NSString stringWithFormat:@"%@",stoneDic[@"msfeOrigin"]];
        
        
        NSDictionary * indentDic = _infoDic[@"orderBook"];
        _goodsAddress.text = [NSString stringWithFormat:@"%@",indentDic[@"orderAddress"]];
        _goodsWeight.text = [NSString stringWithFormat:@"%@",indentDic[@"goodsWeight"]];
        _customName.text = [NSString stringWithFormat:@"%@",indentDic[@"customerName"]];
        _goodsQuality.text = [NSString stringWithFormat:@"%@",indentDic[@"material"]];
        _startAddress.text = [NSString stringWithFormat:@"%@",indentDic[@"beginPort"]];
        _endAddresss.text = [NSString stringWithFormat:@"%@",indentDic[@"endPort"]];
        _transCompany.text = [NSString stringWithFormat:@"%@",indentDic[@"shipcpName"]];
        _passDate.text = [NSString stringWithFormat:@"%@",indentDic[@"dueTime"]];
        _transWeight.text = [NSString stringWithFormat:@"%@",indentDic[@"goodsNum"]];
        _loanCompany.text = [NSString stringWithFormat:@"%@",[indentDic[@"forwardDome"] isEqual:[NSNull null]]?indentDic[@"forwardFore"]:indentDic[@"forwardDome"]];
        
        NSDictionary * oderDic = _infoDic[@"orderContainer"];
        _startDate.text = [NSString stringWithFormat:@"%@",oderDic[@"orderLoadTime"]];
        NSString * images = [NSString stringWithFormat:@"%@",oderDic[@"orderLoadImage"]];
        NSArray * imageArray = [images componentsSeparatedByString:@","];
        for (int i = 0; i<imageArray.count; i++) {
            UIImageView * image = [self.view viewWithTag:100+i];
            [image sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",IP_Address_ImageDown_Fresh,imageArray[i]]]];
        }
    }
}
- (IBAction)back:(id)sender {
    [self backBtn];
}

#pragma mark === 播放
- (IBAction)playVideo:(id)sender {
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
